package com.zcs.android.lib.base

import android.content.Context
import androidx.fragment.app.Fragment

/**
 * Created by ZengCS on 2021/4/27.
 * E-mail:zengcs@vip.qq.com
 * Add:中国成都
 * Desc:类说明
 */
abstract class BaseFragment : Fragment() {
    abstract fun initUI()
    abstract fun initData()

    protected fun useEventBus(): Boolean {
        return false
    }

    override fun onAttach(context: Context) {
        super.onAttach(context)
        if (useEventBus()) {
            // EventBus.getDefault().register(this);
        }
    }

    override fun onDestroyView() {
        super.onDestroyView()
        if (useEventBus()) {
            // EventBus.getDefault().unRegister(this);
        }
    }
}